package com.springboot.study.tests.designpattern.builder;

import java.util.ArrayList;
import java.util.List;

/**
 * @Author: guodong
 * @Date: 2021/5/8 10:41
 * @Version: 1.0
 * @Description:
 */
public class Director {

    private List<String> OrderList = new ArrayList<>();
    private  OrdinaryhouseBuilder ordinaryhouseBuilder=new OrdinaryhouseBuilder();
    private  VillaBuilder villaBuilder=new VillaBuilder();
    /**
     *  普通房屋建造步骤封装
    */
    public OrdinaryhouseModel getHouseModel(){
        this.OrderList.clear();
        this.OrderList.add("stepC");
        this.OrderList.add("stepB");
        this.OrderList.add("stepA");
        this.ordinaryhouseBuilder.setOrderList(OrderList);
        return (OrdinaryhouseModel) this.ordinaryhouseBuilder.getHouseModel();
    }
    /**
     *  别墅建造步骤封装
     */
    public VillaModel getvillaModel(){
        this.OrderList.clear();
        this.OrderList.add("stepA");
        this.OrderList.add("stepB");
        this.OrderList.add("stepC");
        this.villaBuilder.setOrderList(OrderList);
        return (VillaModel) this.villaBuilder.getHouseModel();
    }



}
